//
//  UICGDirectionsWaypoint.m
//  MapDirectionsV3
//
//  Created by Kishikawa Katsumi on 09/12/20.
//  Copyright 2009 Kishikawa Katsumi. All rights reserved.
//

#import "UICGDirectionsWaypoint.h"

@implementation UICGDirectionsWaypoint

@synthesize location;
@synthesize stopover;

- (id)initWithLocation:(id)loc {
    if (self = [self initWithLocation:loc stopover:YES]) {
    }
    return self;
}

- (id)initWithLocation:(id)loc stopover:(BOOL)b {
    if (self = [self init]) {
        self.location = loc;
        self.stopover = b;
    }
    return self;
}

- (void)dealloc {
    [location release];
    [super dealloc];
}

- (NSString *)JSONRepresentation {
    NSString *JSON = [NSString stringWithFormat:
                      @"{'location':'%@', 'stopover':%@}", 
                      location, stopover ? @"true" : @"false"];
    return JSON;
}

@end
